home *** CD-ROM | disk | FTP | other *** search
- Path: ns.cs.hku.hk!sdlee
- From: sdlee@cs.hku.hk (Lee Sau Dan ~{@nJX6X~})
- Newsgroups: hku.open-forum,hku.cc.forum,hk.comp.pc,comp.lang.c++,comp.lang.pascal.misc
- Subject: Re: Is Pascal worth to learn? Can it help me to get a job?
- Date: 15 Jan 1996 08:13:38 GMT
- Organization: Computer Science Dept, University of Hong Kong
- Message-ID: <SDLEE.96Jan15161338@champion.cs.hku.hk>
- References: <30f2adf8.7810115@news.hku.hk> <DL2tFM.7DJ@hkuxb.hku.hk>
- <4dcrl0$7mo_001@news.hku.hk>
- NNTP-Posting-Host: champion.cs.hku.hk
- In-reply-to: kong@hkusua.hku.hk's message of Mon, 15 Jan 1996 06:19:12 GMT
-
- In article <4dcrl0$7mo_001@news.hku.hk> kong@hkusua.hku.hk (someone) writes:
-
- >> I can't agree with this. There are things that you simply
- >> can't do in Pascal.
-
- Yes, but for a beginner, these limitations are not significant.
-
-
- >> For example, in C I can swap two integers a and b without
- >> using a temporary variable in three statements: a ^= b; b ^= a;
- >> a^= b , I can also use bit-vectors.
-
- This method of swapping is not as easy to understand as the method of
- using a temp. variable. Moreover, bit-vectors are for memory
- optimization (and, to a certain extent speed optimization). They are
- difficult to debug and maintain and do not generalize to other
- problems. (E.g. when you swap to strings, you cannot use your proposed
- method.) This is not a good programming practice.
-
- So, to a beginner, these limitations are advantageous. They train
- a programmer to write more structurally and maintainably.
-
-
- >> I can have generic pointers that may point to everything or
- >> nothing.
-
- Well... when you use such pointers, bear in mind the potential problems
- and bugs that may result. Such pointers bypasses the strong type-checking
- mechanism of the language. Think twice and before using such pointers.
- They are often better ways to do the same thing.
-
-
- >> I can have arrays with no compile-time defined sizes.
-
- Beware of out-of-bound array references, then! BTW, does C support
- multi-dimensional arrays cleanly so that they can be passed into
- procedures?
-
-
- >> AFAIK there are no way of doing such things in Pascal. At least
- >> not in standard Pascal. There are also many fallbacks in Pascal
- >> that are inconvenient for programmers,
-
- Well... They are not always inconvenient for programers. Very often,
- they help to prevent bugs early.
-
-
- >> e.g. no break within loops. That's why there are things like
- >> Modula-2.
-
- Some people do not consider 'breaking' in loops a good style of writing
- structured programs. In fact, if you HAVE TO do so, you can do that
- with GOTO in pascal. However, as GOTO is discouraged in structured
- programming, breaks are also not encouraged.
-
-
- >> For the original poster, so far I have only seen one
- >> employer in Hong Kong that specifically requires Pascal. It's
- >> one of those news agencies. And believe it or not, they use
- >> VAX!!
-
- There are even more jobs for dBase, Clipper, FoxPro programmers.
- So, you should persuade all people to learn them, rather than Pascal
- or C.
-
- Anyway, learning a computer language is just a means of learning
- programming. Once you have the skills, you can easily pick up any
- other languages. Most of the time, you just learn a new syntax
- (e.g. when you learn C after knowing Pascal). Sometimes you need to
- learn another paradigm (e.g. OOP in C++). However, the algorithms and
- skills that you know can still apply. Learning a new computer
- language is not as difficult as learning a new human language.
-
-
- --
- Lee Sau Dan
-
- -------------------------------------------------------------------------------
- URL: http://www.cs.hku.hk/~sdlee
- e-mail: sdlee@cs.hku.hk
-